<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">

<head>
<title>로그인 ::: Spring 기반 게시판</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="all" href="../../css/bbs.css" th:href="@{/css/bbs.css}" />

<script>
	function onClickLogin() {
		var f = document.getElementById('userName');
		if (f.value.trim() == '') {
			alert('아이디를 입력하세요.');

			return false;
		}

		var f = document.getElementById('passwd');
		if (f.value.trim() == '') {
			alert('패스워드를 입력하세요.');

			return false;
		}

		return true;
	}
</script>
</head>

<body>
	<div th:include="bbs_header.html::bbs_header"></div>

	<div>
		<h2 th:text="#{bbs.title}">Spring 기반 게시판</h2>

		<form action="bbsUserLogin.con" method="POST">

			<fieldset>
				<legend>로그인 화면</legend>

				<ul class="errorlist">
					<li th:text="${ svrMsg }">메시지</li>
					<li th:if="${ errMsg != null }" th:text="${ errMsg }">에러</li>
				</ul>

				<div>
					<label for="userName"> 아이디 </label> <input type="text" id="userName" name="userName" th:value="${ userName }" value="" />
				</div>
				<div>
					<label for="passwd"> 패스워드 </label> <input type="password" id="passwd" name="passwd" value="" />
				</div>
				<div>
					<label for="isAdmin"> 관리자 </label> <input type="checkbox" name="isAdmin" th:checked="${ isAdmin }" th:value="${ isAdmin }" value=""
						onclick="this.value = this.checked" />
				</div>
				<div> 
				</div>
				<div>
					<input type="hidden" name="redirectUrl" value="" th:value="${ redirectUrl }" />
					<label for="login"> &nbsp; </label>
					<button type="submit" id="logIn" onclick="return onClickLogin();" style="vertical-align: middle;" >로그인</button>
				</div>

			</fieldset>

		</form>

	</div>

	<br />
	<div th:include="bbs_footer.html::bbs_footer"></div>

</body>
</html>